<?php
namespace Home\Controller;
use Think\Controller;
use Think\Model;
class UserController extends Controller {
    public function index(){
        $this->display('index', 'utf-8', 'text/html');
    }
    public function changeShop($shopId){
      echo $shopId;
    }
    public function addShop($sn,$sd,$st){
      $Shop = M('Shop');
      $data=array(
              'shopName'=>$sn,
              'shopDescribe'=>$sd,
              'shopType'=>$st,
        );
      $arr;
     if($sn==''){
        $arr=array('error'=>'店铺名为空');
         echo json_encode($arr);
        return false;
      }else{
          $Shop->add($data);
      }
      

      // $Shop -> find($sn);
     
      // var_dump($Shop);
       // echo $Shop;
    }
    public function add($name=0){

    	$User =M('User');
        // $User['name']=$_post['name'];
     //    echo $name;
     //    $data['name']='殷桃小丸子';
     //    $data['email']='ss';
    	// // $users=$User->select();
     //    // dump($users);
     //    $User->add($data);
     //     echo M()->getLastSql();
      $User ->find('1');
      $User->name='top';
      echo $User->name;
      echo $User->id;
      echo $User->email;
       $a=$User->email;
      $User->save();
       // dump($User);
      // ehco $User->id;
      $this->assign('name',$a);
      $this->display('add', 'utf-8', 'text/html');
     
    }


}